package com.entity.pojo;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

public class Article {
    private String newsId;

    @NotNull
    @Pattern(regexp = "^[a-zA-Z0-9\\u4E00-\\u9FFF]{4,9}$",message = "标题不符合规则")
    private String newsTitle;

    private String newsImgUrl;

    private String newsSummary;

    private Date newsPublishTime;

    private String newsAuthor;

    private String newsSource;

    private Byte newsState;

    private String typeId;

    private String userId;

    @NotNull
    @Pattern(regexp = "^[a-zA-Z0-9\\u4E00-\\u9FFF]{10,}$",message = "内容不符合规则")
    private String newsContent;

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    public ArticleType getArticleType() {
        return articleType;
    }

    public void setArticleType(ArticleType articleType) {
        this.articleType = articleType;
    }

    private  SystemUser systemUser;

    private ArticleType articleType;

    public String getNewsId() {
        return newsId;
    }

    public void setNewsId(String newsId) {
        this.newsId = newsId == null ? null : newsId.trim();
    }

    public String getNewsTitle() {
        return newsTitle;
    }

    public void setNewsTitle(String newsTitle) {
        this.newsTitle = newsTitle == null ? null : newsTitle.trim();
    }

    public String getNewsImgUrl() {
        return newsImgUrl;
    }

    public void setNewsImgUrl(String newsImgUrl) {
        this.newsImgUrl = newsImgUrl == null ? null : newsImgUrl.trim();
    }

    public String getNewsSummary() {
        return newsSummary;
    }

    public void setNewsSummary(String newsSummary) {
        this.newsSummary = newsSummary == null ? null : newsSummary.trim();
    }

    public Date getNewsPublishTime() {
        return newsPublishTime;
    }

    public void setNewsPublishTime(Date newsPublishTime) {
        this.newsPublishTime = newsPublishTime;
    }

    public String getNewsAuthor() {
        return newsAuthor;
    }

    public void setNewsAuthor(String newsAuthor) {
        this.newsAuthor = newsAuthor == null ? null : newsAuthor.trim();
    }

    public String getNewsSource() {
        return newsSource;
    }

    public void setNewsSource(String newsSource) {
        this.newsSource = newsSource == null ? null : newsSource.trim();
    }

    public Byte getNewsState() {
        return newsState;
    }

    public void setNewsState(Byte newsState) {
        this.newsState = newsState;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId == null ? null : typeId.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getNewsContent() {
        return newsContent;
    }

    public void setNewsContent(String newsContent) {
        this.newsContent = newsContent == null ? null : newsContent.trim();
    }

    public String toString() {
        return "Article{" +
                "newsId='" + newsId + '\'' +
                ", newsTitle='" + newsTitle + '\'' +
                ", newsImgUrl='" + newsImgUrl + '\'' +
                ", newsSummary='" + newsSummary + '\'' +
                ", newsPublishTime=" + newsPublishTime +
                ", newsAuthor='" + newsAuthor + '\'' +
                ", newsSource='" + newsSource + '\'' +
                ", newsState=" + newsState +
                ", typeId='" + typeId + '\'' +
                ", userId='" + userId + '\'' +
                ", newsContent='" + newsContent + '\'' +
                ", systemUser=" + systemUser +
                ", articleType=" + articleType +
                '}';
    }
}